from visual import *
import random
import numpy
import math
from scrollgraph import *

GRAPH_VALUES = 40
test1=Scrollgraph()
display(x=0, y=0, center=(0,0,0))
box = box()
box.velocity = vector(0,0,3)
values = []
t = 0.1
i = 0
indiceseno=test1.addcurva()
indicerandom=test1.addcurva()
while True:
	i += 1
	y =t*math.sin(t)
	ry=cos(t)*random.uniform(0,2)
	rate(10)
	box.rotate(angle=pi/y, axis=(t,random.uniform(0,360),random.uniform(0,360)), origin=(0,0,0))
	test1.plot(indiceseno,(t,y))
	test1.plot(indicerandom,(t,ry))
	t += 0.1		
	test1.ncen((-12+t,0))
	#print scene.mouse.project(normal=(0,0,1)) 
